<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const {
      log: l
    } = console;

    // 题目：将用户输入的网址全部转化成我们的官网。如www.baidu.com=>www.lagou.com
    let link = 'www.baidu.com';

    let zz = /^(www.)\w+(.com)$/;

    link = link.replace(zz, '$1lagou$2');
    
    l(link);
  </script>
</body>

</html>